import time
import random
def oter(func,num):
    def inner():
        if func==sleep:
            print("我睡觉了")
            func(num)
            print("我起床了")
        else:
            print("我工作了")
            func(num)
            print("我休息了")

    return inner

def Time(num):
    time.sleep(random.randint(1, num))
def sleep(num):
    print("睡眠中...")
    Time(num)

def job(num):
    print("工作中...")
    Time(num)

fn1 = oter(sleep,6)
fn1()
fn2 = oter(job,12)
fn2()
